package level4project.v4modify_decorator.view;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Stroke;

import javax.swing.JPanel;

public class BarView extends JPanel {
	private Color color;
	
	public BarView(Color color) {
		this.color = color;
	}

	protected void paintComponent(Graphics g) { 		
		super.paintComponent(g);
		Graphics2D g2 = (Graphics2D)g;
		g2.clearRect(5,0,30,5);
		Stroke dash = new BasicStroke(1.0f,BasicStroke.CAP_ROUND ,BasicStroke.JOIN_MITER,10.0f,new float[]{3,3,},0f);
		g2.setStroke(dash);
		
		g2.setColor(color);
		g2.drawRect(5,0,30,5);
		g2.dispose();
		
		//g.setColor(color);		
		//g.fillRect(5, 0, 30, 5);
	}
}